$(function(){
    $.get('http:localhost:3000/blog',(data=>{
        return new Promise().then(item=>{
            data.forEach(item=>{
               let html=`
            <tr>
               <td>${item.id}</td>
               <td>${item.title}</td>
               <td>${item.zy}</td>
               <td>${item.body}</td>
               <td>${item.type}</td>
               <td>${item.author}</td>
               <td>${item.time}</td>
               <td><input type="button" value="编辑" onclick="edit(${item.id})"></td>
               <td><input type="button" value="删除" onclick="del(${item.id})"></td>
           </tr>
               `
               $('#tbData').append(html)
            })
        })
    }))
})

function query(){
    let keyword=$('keyword');
    
}
function getJsonResulr(){

}

function renderFn(arr){

}
function add(){
    location.href='./addOrEdit.html'
}
function save(){
    location.href='./addOrEdit.html'
}
function cancel(){
    location.href='./index.html'
}